
Imports std

Public Interface storageInterface
    Function read(ByVal key As String, ByRef buff As bytes) As Boolean
    Function write(ByVal key As String, ByVal buff As bytes) As Boolean
    Function uniqueWrite(ByVal key As String, ByVal buff As bytes) As Boolean
    Function delete(ByVal key As String) As Boolean
    Function seek(ByVal key As String) As Boolean
    Function list(ByRef keys As vector(Of String)) As Boolean
    Function modify(ByVal key As String, ByVal buff As bytes) As Boolean
    Function sizeof(ByVal key As String, ByRef size As UInt64) As Boolean
    Function open() As Boolean
    Function close() As Boolean
    Function full() As Boolean
    Function health() As Boolean
    Function retire() As Boolean
    Function empty() As Boolean
    Function capacity(ByRef cap As UInt64) As Boolean
    Function valuesize(ByRef size As UInt64) As Boolean
    Function keycount(ByRef count As UInt64) As Boolean
    Function status(ByRef allSlicesCount As UInt64, ByRef unhealthSlicesCount As UInt64) As Boolean
    'sync to function, sync any data to destination storserver, for redundancy mode
    'make a copy of local data to other storserver, but do not care about the data which is not in this storageInterface
    Function sync(ByVal desthost As String, ByVal destport As Int32) As Boolean
End Interface

Public Interface comparableStorageInterface(Of T)
    Inherits storageInterface, IComparable(Of T)
End Interface
